package day01.比较器;

import java.util.Comparator;

/**
 * @author feng
 * @Date 2021/10/17 16:21
 * 外部比较器
 */
public class BiJiao implements Comparator<Student> {

    @Override
    public int compare(Student o1, Student o2) {
        return o1.getName().compareTo(o2.getName());
    }
}

class Test02 {
    public static void main(String[] args) {
        BiJiao biJiao = new BiJiao();
        Student s1 = new Student("bhangsan",20,180.0);
        Student s2 = new Student("aisi",40,190.0);
        System.out.println(biJiao.compare(s1,s2));

    }


}